<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
    <style>
        .layui-form-item .layui-form-label{
            width: 120px;
        }
        .layui-form-item .layui-textarea{
            width: 190px;
        }
        #phone-one-div {display: none}
        .layui-form-select {z-index: 99999 !important}
    </style>
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form">
            <input type="hidden" name="id" value="{$data.id}">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>推荐的外请直播联系人信息</legend>
        </fieldset>
        {if $data.id && !$data.recommend_liveer_name && $data.step < 2 }
        
          <div class="layui-form-item">
              <label for="recommend_liveer_name" class="layui-form-label">
                  推荐外请直播联系人
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.recommend_liveer_name}" lay-verify="required" id="recommend_liveer_name" name="recommend_liveer_name" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="recommend_liveer_phone" class="layui-form-label">
                  推荐外请直播联系电话/微信
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.recommend_liveer_phone}" lay-verify="required" id="recommend_liveer_phone" name="recommend_liveer_phone" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="recommend_liveer_price" class="layui-form-label">
                  推荐价格
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.recommend_liveer_price|default='0'}" lay-verify="required" id="recommend_liveer_price" name="recommend_liveer_price"  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="recommend_liveer_bill" class="layui-form-label">
                  能否开票
              </label>
              <div class="layui-input-inline">
                    <input type="radio" name="recommend_liveer_bill" value="1" title="能" {$data.recommend_liveer_bill==1?'checked':''}>
                    <input type="radio" name="recommend_liveer_bill" value="-1" title="不能" {$data.recommend_liveer_bill==-1?'checked':''}>
              </div>
          </div>
          <input type="hidden" name="step" value="1">
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button type="button" class="layui-btn" lay-filter="add" lay-submit="">
                  确定
              </button>
          </div>
          
        {/if}
 
 
          {if $data.id && $data.recommend_liveer_name }
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  推荐外请直播联系人
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.recommend_liveer_name}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  推荐外请直播联系电话/微信
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.recommend_liveer_phone}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  推荐价格
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.recommend_liveer_price}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  能否开票
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.recommend_liveer_bill==1?'能':'不能'}
              </div>
          </div>
          {if ($data.admin_id == session('uid','','admin') || session('uid','','admin')  == 1) && $data.step < 2}
          
          <div class="layui-form-item">
              <label for="activity_need_device" class="layui-form-label">
                  <span class="x-red">*</span>是否采用推荐
              </label>
              <div class="layui-input-inline">
                  <select name="need_recommend" id="need_recommend" lay-filter="need_recommend" lay-verify="required" required="">
                        <option value="">请选择</option>
                        <option value="1">采用</option>
                        <option value="-1">不采用(自填)</option>
                  </select>
              </div>
          </div>
          
          <div style="display:none" id="liveer-box">
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  外请直播联系人
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.liveer_name}" id="liveer_name" name="liveer_name" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_phone" class="layui-form-label">
                  外请直播联系电话/微信
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.liveer_phone}" id="liveer_phone" name="liveer_phone" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_price" class="layui-form-label">
                  价格
              </label>
              <div class="layui-input-inline">
                  <input type="text" value="{$data.liveer_price|default='0'}" id="liveer_price" name="liveer_price"  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_bill" class="layui-form-label">
                  能否开票
              </label>
              <div class="layui-input-inline">
                    <input type="radio" name="liveer_bill" value="1" title="能" {$data.liveer_bill==1?'checked':''}>
                    <input type="radio" name="liveer_bill" value="-1" title="不能" {$data.liveer_bill==-1?'checked':''}>
              </div>
          </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button type="button" class="layui-btn" lay-filter="add" lay-submit="">
                  确定
              </button>
          </div>
          
          {/if}

          {/if}

 
          {if $data.id && $data.liveer_name}
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>最终选择外请直播联系人信息</legend>
        </fieldset>
          <div class="layui-form-item">
              <label for="liveer_name" class="layui-form-label">
                  外请直播联系人
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.liveer_name}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_phone" class="layui-form-label">
                  外请直播联系电话/微信
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.liveer_phone}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_price" class="layui-form-label">
                  价格
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                  {$data.liveer_price}
              </div>
          </div>
          <div class="layui-form-item">
              <label for="liveer_bill" class="layui-form-label">
                  能否开票
              </label>
              <div class="layui-input-inline" style="line-height: 38px;">
                   {$data.liveer_bill==1?'能':'不能'}
              </div>
          </div>

          
          {/if}
          
          {if (session('uid','','admin')  == 1 || session('uid','','admin')  == 12) && $data.step == 2}
          <div class="layui-form-item"> 
              <label for="L_repass" class="layui-form-label">
              </label>
              <button type="button" class="layui-btn layui-btn-normal" lay-filter="pass" lay-submit="">
                  通过
              </button>
              <button type="button" class="layui-btn layui-btn-warm" lay-filter="nopass" lay-submit="">
                  不通过
              </button>
          </div>
          {/if}
      </form>
    </div>
    <script src="/static/admin/js/wangEditor.min.js"></script>
    <script>

    
    
    layui.use(['form','layer','laydate','upload','layarea','rate'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate
          ,upload = layui.upload
          ,layarea = layui.layarea
          ,rate = layui.rate;
        form.on('select(need_recommend)', function(data){
            if(data.value == -1)
                $('#liveer-box').show()
            else
                $('#liveer-box').hide()
        });      
        form.on('submit(add)', function(data){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:data.field,
                success:function(obj){
                      layer.alert(obj.msg, {icon: obj.icon},function(){
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                        // 可以对父窗口进行刷新 
                        x_admin_father_reload();
                      });    
                }
            });
            return false;
        });
        form.on('submit(pass)', function(data){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{id:{$data.id},step:3},
                success:function(obj){
                      layer.alert(obj.msg, {icon: obj.icon},function(){
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                        // 可以对父窗口进行刷新 
                        x_admin_father_reload();
                      });    
                }
            });
            return false;
        });
        form.on('submit(nopass)', function(data){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{id:{$data.id},step:0,liveer_name:'',liveer_phone:'',liveer_price:'',liveer_bill:''},
                success:function(obj){
                      layer.alert(obj.msg, {icon: obj.icon},function(){
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                        // 可以对父窗口进行刷新 
                        x_admin_father_reload();
                      });    
                }
            });
            return false;
        });
        
    });
    </script>
  </body>

</html>